package com.hst.capacity.infra.convertor;

import com.hst.capacity.domain.model.entity.franchisee.AgentEntity;
import com.hst.capacity.domain.model.entity.setting.commision.AgentCommisionEntity;
import com.hst.capacity.domain.model.request.agent.AgentSaveParam;
import com.hst.capacity.domain.model.response.LabelValueVO;
import com.hst.capacity.domain.model.response.agent.AgentCommisionSaveParam;
import com.hst.capacity.domain.model.response.agent.AgentCommisionSelectVO;
import com.hst.capacity.domain.model.response.agent.AgentSearchVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.MappingTarget;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 *  快车订单模块的POJO属性转换器
 *
 * @author jin
 * */
@Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface AgentConvertor {
    AgentConvertor INSTANCE = Mappers.getMapper(AgentConvertor.class);

    AgentSearchVO convertSelect(AgentEntity agentEntity);

    @Mapping(target = "label",source = "agentName")
    @Mapping(target = "value",source = "idAgent")
    LabelValueVO covert(AgentEntity entity);
    List<LabelValueVO> covert(List<AgentEntity> byIdFranchisee);

    AgentCommisionSelectVO covert(AgentCommisionEntity entity);

    AgentCommisionSaveParam covertSaveSelect(AgentCommisionEntity entity);

    void covert(@MappingTarget AgentCommisionEntity entity, AgentCommisionSaveParam param);
}
